package com.zheng.damo01.homeWeark.作业五;

public class AppleTest {
    public static void main(String[] args) {
        Apple apple=new Apple(5,"青色");
        Apple apple1=new Apple(3,"红色");
        Worker worker=new Worker();
        worker.pockApple(new CompareAble() {
            @Override
            public void CompareAble(Apple apple1, Apple apple2) {
                CompareAble.super.CompareAble(apple1, apple2);
            }
        },apple,apple1);
        Worker worker1=new Worker();

        worker1.pockApple(new CompareAble() {
            @Override
            public void CompareAble(Apple apple1, Apple apple2) {
                System.out.println("挑红的");
                if (apple1.getColor().equals("红色")){
                    System.out.println(apple1);
                }else if (apple2.getColor().equals("红色")){
                    System.out.println(apple2);
                }
            }
        },apple,apple1);
    }
}
